package com.jn.service.hollyService;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
@Transactional
public class VacService {

	private static Logger logger = LoggerFactory.getLogger(VacService.class);
	@Autowired
	private JdbcTemplate jdbcTemplate;

	/**
	 * @Title getTerminalsWithOutCity
	 * @Description 获取VAC没有地市的终端
	 * @return
	 */
	public List<String> getTerminalsWithOutCity() {
		List<String> returnList = new ArrayList<String>();
		String sql = "select terminal_no from ia_terminal_status where city_name is null or city_name=''";
		List<Map<String, Object>> terminalList = jdbcTemplate.queryForList(sql);
		logger.info("获取VAC没有地市的终端完毕，共有 " + terminalList.size() + " 个");
		for (Map<String, Object> map : terminalList) {
			returnList.add(String.valueOf(map.get("terminal_no")));
		}
		return returnList;
	}

}
